//
//  EFBaseViewController.h
//  EFHealth
//
//  Created by liumadu on 14-11-28.
//  Copyright (c) 2018年 ef. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "AppMacro.h"
#import "UILabel+Ext.h"
#import "UIView+Ext.h"
#import "PublicUtils.h"
#import "EFConst.h"
#import "EFShowView.h"

#import "EFAppContext.h"
#import "EFNavigationBarView.h"

@class BaseModel ;


typedef NS_ENUM(NSInteger, loadingType) {
    loadingTypeDefault ,
    loadingTypeLoding ,
    loadingTypeNoData ,
    loadingTypeNetError ,
    //    loadingTypeNoNet ,
};

typedef void(^allertMessageCallback)(void);

@interface EFBaseViewController : UIViewController

@property (nonatomic, strong)UIView *statusOrangeView ;//顶部颜色条

@property (nonatomic,strong,readonly)EFNavigationBarView *navBarView ;

- (void)bringNavBarToTopmost ;

- (void)navigationDragCanBack:(BOOL)canBack ;

- (void)bgViewTap;



/***********返回**********/
- (void)backWithDelay:(int)delayTime;
//子类实现此方法可以控制跳转到指定的界面
- (void)returnVC;

- (void)initModel;
- (void)initView;


// hud functions
- (void)showHUD;
- (void)showHUDWithLabel:(NSString *)msg;
- (void)showHUDInWidownWithMsg:(NSString *)msg;

- (void)hideHUD;
- (void)hideHUDAfterDelay:(float)delay;
- (void)showHUDInView:(UIView *)view msg:(NSString *)msg ;



/*********没有数据提示********/
- (void)showNoDataWithTitle:(NSString *)title ;
- (void)showNoDataWithTitle:(NSString *)title inView:(UIView *)view ;
- (void)showNoDataWithHimg:(NSString *)himg title:(NSString *)title inView:(UIView *)view ;
- (void)showNoNetWithDelegate:(id)delegate ;
- (void)showNoNetWithDelegate:(id)delegate inView:(UIView *)view ;
- (void)hiddenNoDataView ;


//- (void)showLoginView:(id<LoginControllerProtocol>)delegate;
- (void)handleModelError:(id)sender error:(NSError*)error;
- (void)handleSuccess:(id)seder data:(id)data ;

- (void)getDataFinish:(BaseModel *)baseModel netError:(NSError *)error ;

- (void)appLogin ;

//支付宝回调方法
-(void)alipayWithCode:(NSString *)code;


- (void)showAlertMessageWithTitle:(NSString *)title contentMessage:(NSString *)contentMessage cancelTitle:(NSString *)cancelTitle cancelCallBack:(allertMessageCallback)cancel sureTitle:(NSString *)sureTitle sureCallBack:(allertMessageCallback)sure ;
@end




















